package oldGui;

import javax.swing.JPanel;

import java.awt.BorderLayout;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.SwingConstants;
import java.awt.Dimension;
import java.awt.GridLayout;

public class ProcessorPanel extends JPanel {
	
	private JLabel dateLabel;
	private ArrayList<EditPanel> editPanels;
	private SimpleDateFormat df;
	private String date;
	
	public ProcessorPanel() throws IOException {
		setPreferredSize(new Dimension(500, 500));
		df = new SimpleDateFormat("MMMMMMMMMMM dd HH:mm");
		date = df.format(new Date());
		setLayout(new GridLayout(11, 1, 0, 0));
		
		dateLabel = new JLabel(date);
		dateLabel.setHorizontalAlignment(SwingConstants.CENTER);
		dateLabel.setFont(new Font("Papyrus", Font.BOLD, 24));
		dateLabel.setBackground(Color.WHITE);
		add(dateLabel);
		
		editPanels = new ArrayList<EditPanel>(0);
		
	}
	
	public void refresh(Date newDate) {
		date = df.format(newDate);
		dateLabel.setText(date);
		dateLabel.repaint();
		
	}

	public JLabel getDateLabel() {
		return dateLabel;
	}

	public void setDateLabel(JLabel dateLabel) {
		this.dateLabel = dateLabel;
	}

	public ArrayList<EditPanel> getEditPanels() {
		return editPanels;
	}

	public void setEditPanels(ArrayList<EditPanel> editPanels) {
		this.editPanels = editPanels;
	}

}
